package com.oracle.lingshangejia.model.bean;


import com.lws.basic.utils.common.SharePreferenceUtils;
import com.oracle.lingshangejia.MyApp;
import com.oracle.lingshangejia.R;
import com.oracle.lingshangejia.utils.SpUtils;

/**
 * @松 on 2019/10/28 14:03
 */
public class User {
    public static String getToken(){
        String token =  (String) SpUtils.get(MyApp.getContext(),"token", "");
        return token;
    }

    public static int getUserId(){
        int id = (int)SpUtils.get(MyApp.getContext(),"ysid", 0);
        return id;
    }

    //过去属于医生id
    /*public static int getDoctorId(){
        int id = SharePreferenceUtils.getInt(MyApp.getContext(), Constant.doctor_id, 0);
        return id;
    }
*/
    //返回数值对应的民族
    public static String getNation(int num){
        String[] strings = MyApp.getContext().getResources().getStringArray(R.array.nation_archives);
        String nation="";
        for (int i= 0; i< strings.length ; i++){
              if (strings[i].contains(num+"")){
                  nation = strings[i];
                  break;
              }
        }
      //  nation = nation.substring(1);//
        return nation;
    }
    //返回数值对应的学历
    public static String getEducation(int num){
        String[] strings = MyApp.getContext().getResources().getStringArray(R.array.archives_education);
        String nation="";
        for (int i= 0; i< strings.length ; i++){
            if (strings[i].contains(num+"")){
                nation = strings[i];
                break;
            }
        }
        //nation = nation.substring(1);//
        return nation;
    }


}
